<?php use_helper('Date') ?>
<?php use_helper('Number') ?>
<h3 style="float:left; text-decoration: underline; font: 26px/30px 'Yanone Kaffeesatz','Trebuchet MS'; color: #72A545; width: 85%;"><?php echo $reserva->getViviendasAlquileres()->getFullName($reserva->getViviendasAlquileres()) ?> <span style="margin-left: 25%;"> <?php echo __("suReservaTitle", array('%0%' => $reserva->getDsorder()."-".$reserva->getId())) ?><span></h3>
<div class="closeSession"><?php echo link_to(__('closeSession'), '@reservas_logout'); ?></div>
<h5 style="clear: both;"><?php if(count($reserva->getAlquileresPrecios())>0): ?>
	<?php foreach ($reserva->getAlquileresPrecios() as $semana): ?>
		<span style="background-color: #EEE; margin-right: 10px; font-size: 15px;"><?php echo format_date($semana->getFechaInicio(), 'dd MMMM yyyy') ?> - <?php echo format_date($semana->getFechaFin(), 'dd MMMM yyyy') ?></span> 
	<?php endforeach; ?>
<?php endif ?>
</h5>


<table id="one-column-emphasis" style="margin-top: 20px; width: 100%;">
  <thead>
    <tr>
    	<th></th>
    	<th></th>
    	<th><?php echo __('nombrereserva', null, 'forms') ?></th>
    	<th><?php echo __('apellidosreserva', null, 'forms') ?></th>
    	<th><?php echo __('fechanacreserva', null, 'forms') ?></th>
    	<th><?php echo __('nacionalidadreserva', null, 'forms') ?></th>
    	<th><?php echo __('tipodocumentoreserva', null, 'forms') ?></th>
    	<th><?php echo __('dnipasaportereserva', null, 'forms') ?></th>
    	<th></th>
    	<th></th>
    </tr>
  </thead>
  <tbody>
	<?php $i=1; foreach ($reserva->getReservasPersonas() as $persona): ?>
  	<tr>
  		<td><?php echo $i ?>
  		<?php if($persona->getResponsablereserva()): ?>
  		<img style="vertical-align: sub;" title="<?php echo __('responsable') ?>" alt="<?php echo __('responsable') ?>" src="/images/asterisk_yellow.png" />
  		<?php endif ?>
  		</td>
		<td><?php echo Util::getTituloForm($persona->getSexoreserva()) ?></td>
		<td><?php echo $persona->getNombrereserva() ?></td>
		<td><?php echo $persona->getApellidosreserva() ?></td>
		<td><?php echo format_date($persona->getFechanacreserva(), 'd MMM y') ?></td>
		<td><?php echo Util::getCountry($persona->getPaisreserva()) ?></td>
		<td><span alt="<?php echo __(Util::getTypeDocumento($persona->getTipodocumentoreserva())) ?>" title="<?php echo __(Util::getTypeDocumento($persona->getTipodocumentoreserva())) ?>"><?php echo Util::getPalabraAcortada(__(__(Util::getTypeDocumento($persona->getTipodocumentoreserva())), null, 'forms'), 25) ?></span></td>
		<td><?php echo $persona->getDnipasaportereserva() ?></td>
  		<td><?php echo link_to(__('editar'), '@personaedit_'.$sf_user->getLangCulture()."?dsorder=".$reserva->getDsorder()."&id=".$persona->getId(), array('class' => 'actions'))?> | </td>
  		<td><?php if(!$persona->getResponsablereserva()): ?><?php echo link_to(__('borrar'), "reservas/deletePersona?dsorder=".$reserva->getDsorder()."&id=".$persona->getId(), array('method' => 'delete', 'confirm' => __('areYouSure'), 'class' => 'actions'))?><?php endif ?></td>
	</tr>
	<?php $i++; endforeach ?>
  </tbody>
  </table>
  <?php echo link_to('+'.__('nuevoOcupante'), 'reservas/newPersona?reserva_id='.$reserva->getId()."&dsorder=".$reserva->getDsorder(), array('class' => 'actions newuser')) ?>